package com.ruoyi.iot.dataprocessing.service.impl;

import com.ruoyi.iot.dataprocessing.strategy.SensorMessageStrategy;
import net.dreamlu.iot.mqtt.spring.client.MqttClientTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class PushService {

    @Autowired
    private MqttClientTemplate client;
    @Autowired
    private SensorMessageStrategy sensorMessageStrategy;
    @Async("asyncServiceExecutor")
    public void push(Integer type,Long customerId,byte[] payload) {
        sensorMessageStrategy.push(type,customerId,payload);

    }
}
